home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-01-05 | 1.9 KB | 103 lines | [TEXT/GEOL] |
- Item 6054815 4-Jan-90 10:57
-
- From: KNEPPER Knepper, Christopher
-
- To: D4602 Mass Microsystems, William May,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re-Modal Dialogs?
-
- Hi Bill,
-
- Here's a 'view' resource description which supports a modal dialog like you're
- trying to do, along with some code which manages it. The Return/Enter/Cmd-'.'
- keys work as you would expect in a normal modal dialog.
-
- Good luck!
-
- -Chris
-
- resource 'view' (9700, "test", purgeable) {
- { root, 'WND!',
- { 50, 40 }, { 352, 384 }, sizeFixed, sizeFixed, shown, enabled,
- Window {
- "TWindow",
- dBoxProc,
- noGoAwayBox,
- notResizable,
- modal,
- ignoreFirstClick,
- freeOnClosing,
- disposeOnFree,
- doesntCloseDocument,
- dontOpenWithDocument,
- dontAdaptToScreen,
- dontStagger,
- dontForceOnScreen,
- center,
- 'Cnfg',
- ""
- },
- /* [2] */
- 'WND!', 'Cnfg',
- { 0, 0 },
- { 352, 464 }, sizeFixed, sizeFixed, shown, enabled,
- DialogView {
- "",
- 'OK!!',
- 'ByBy'
- },
- /* [3] */
- 'Cnfg', 'OK!!',
- { 288, 285 },
- { 26, 86 }, sizeFixed, sizeFixed, shown, enabled,
- Button {
- "TButton",
- 0b1000000,
- {3, 3},
- notSizeable,
- notDimmed,
- notHilited,
- dismisses,
- {4, 4, 4, 4},
- systemFont,
- "OK"
- },
- /* [5] */
- 'Cnfg', 'ByBy',
- { 320, 286 },
- { 20, 80 }, sizeFixed, sizeFixed, shown, enabled,
- Button {
- "TButton",
- 0b0,
- {1, 1},
- notSizeable,
- notDimmed,
- notHilited,
- dismisses,
- noInset,
- systemFont,
- "Cancel"
- },
-
- …
- }
- };
-
- { Hint: Notice that the DialogView is enabled }
-
- And now here's some code to manage the modal dialog:
-
- aWindow := NewTemplateWindow(9700, NIL); { create window }
- FailNIL(aWindow);
- aDialogView := TModulesDlog(aWindow.FindSubView('Cnfg'));
- FailNIL(aDialogView);
- dismisser := aDialogView.PoseModally; { modal dialog }
- IF (dismisser = 'ByBy') THEN
- {cancel button was clicked}
- ELSE IF (dismisser = 'OK!!') THEN
- {OK button was clicked}
-
-
-